package com.piece.admin.config;

import com.piece.core.oauth.config.AuthorizationServerProvider;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.oauth2.provider.ClientDetailsService;
import org.springframework.security.oauth2.provider.OAuth2RequestFactory;
import org.springframework.security.oauth2.provider.TokenGranter;
import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices;
import java.util.ArrayList;
import java.util.List;

@Configuration
public class AuthorizationServerConfigurerProvider implements AuthorizationServerProvider {

    @Override
    public List<TokenGranter> addTokenGranter(AuthenticationManager authenticationManager,
                                              OAuth2RequestFactory requestFactory,
                                              AuthorizationServerTokenServices tokenServices,
                                              ClientDetailsService clientDetailsService) {
        List<TokenGranter> granters = new ArrayList<>();
        if (null != authenticationManager) {

        }

        return granters;
    }

    @Override
    public int getOrder() {
        return 100;
    }
}
